# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import sys
from django.contrib import admin

# Register your models here.
from django.contrib.admin import ModelAdmin

from app_device.models import *
reload(sys);
sys.setdefaultencoding("utf8")

@admin.register(Devices)
class DevicesAdmin(ModelAdmin):
    list_display = ('name', 'code', 'brand', 'model', 'number', 'address', "status")
    exclude = ('create_date', 'update_date')
    search_fields = ('name', 'code', "brand")  # 页面添加查询栏


@admin.register(DeviceImg)
class DeviceImgAdmin(ModelAdmin):
    list_display = ('device','name', 'desc', 'url', 'path', 'status')
    exclude = ('create_date', 'update_date')
